package com.sss.gsb.orm.model;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name = "GSB_WS_BONDSMAN_CPK")
public class BondsMan implements Serializable {
	@Transient
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}
	
	@Transient
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		BondsMan other = (BondsMan) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = -7617496770182641392L;	
	
	@Id @Column(name="BONDID")
	private BigDecimal id;
	
	@ManyToOne
	@JoinColumn(name="CID")
	private Loan loan;
	

	@Column(name="ORDER_NO")
	private  Integer orderNo  ;
	
	
	@Column(name="BOND_CIZID")
	private String bondIdCard;	
	
	
	@Column(name="BOND_TITLE")
	private String bondTitle;
	
	
	@Column(name="BOND_NAME")
	private String bondName;	
	
	
	@Column(name="BOND_SURNAME")
	private String bondSurname;
	
	
	@Column(name="BOND_UNDER_UNIT")
	private String bondUnderUnit;
	
	
	@Column(name="A_ADD")
	private String address;	
	
	
	@Column(name="A_L_SDC")
	private String tambolId1;
	
	
	@Column(name="A_TAMBOL")
	private String registerTambol;
		
	
	@Column(name="A_CITY")
	private String amphur1;
	
	
	@Column(name="A_AMPHUR")
	private String registerAmphur;
	
	
	@Column(name="A_STATE")
	private String province1;
	
	
	@Column(name="A_PROV")
	private String registerProvince;
		
	
	@Column(name="A_ZIP")
	private String zipcode;
	
	
	@Column(name="A_H_PH")
	private String homePhoneNo;
	
	
	@Column(name="B_ADD")
	private String businessAddress;
	
	
	@Column(name="B_O_SDC")
	private String tambol2;
	
	
	@Column(name="B_TAMBOL")
	private String businessTambol;
	
	
	@Column(name="B_CITY")
	private String amphur2;
	
	
	@Column(name="B_AMPHUR")
	private String businessAmphurId;
		
	
	@Column(name="B_STATE")
	private String province2;
	
	
	@Column(name="B_PROV")
	private String businessProvince;
	
	
	@Column(name="B_ZIP")
	private String businessZipcode;
	
	
	@Column(name="B_W_PH")
	private String workPhoneNo;
	

	@Column(name="B_FAX")
	private String workFax;
	
	
	@Column(name="C_ADD")
	private String contactAddress;
	
	
	@Column(name="C_M_SDC")
	private String tambol3;
	
	
	@Column(name="C_TAMBOL")
	private String contactTambol;
	
	
	@Column(name="C_CITY")
	private String amphur3;
	
	
	@Column(name="C_AMPHUR")
	private String contactAmphur;
	
	
	@Column(name="C_STATE")
	private String province3;
	
	
	@Column(name="C_PROV")
	private String contactProvince;
	
	
	@Column(name="C_ZIP")
	private String contactZipcode;
	
	
	@Column(name="C_O_PH")
	private String contactPhoneNo;

	@Embedded
	private RecordInfo recordInfo;

	public BigDecimal getId() {
		return id;
	}

	public void setId(BigDecimal id) {
		this.id = id;
	}

	public Loan getLoan() {
		return loan;
	}

	public void setLoan(Loan loan) {
		this.loan = loan;
	}

	public Integer getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(Integer orderNo) {
		this.orderNo = orderNo;
	}

	public String getBondIdCard() {
		return bondIdCard;
	}

	public void setBondIdCard(String bondIdCard) {
		this.bondIdCard = bondIdCard;
	}

	public String getBondTitle() {
		return bondTitle;
	}

	public void setBondTitle(String bondTitle) {
		this.bondTitle = bondTitle;
	}

	public String getBondName() {
		return (bondName == null)?"":this.bondName;
	}

	public void setBondName(String bondName) {
		this.bondName = bondName;
	}

	public String getBondSurname() {
		return (bondSurname == null)?"":this.bondSurname;
	}

	public void setBondSurname(String bondSurname) {
		this.bondSurname = bondSurname;
	}

	public String getBondUnderUnit() {
		return bondUnderUnit;
	}

	public void setBondUnderUnit(String bondUnderUnit) {
		this.bondUnderUnit = bondUnderUnit;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getTambolId1() {
		return tambolId1;
	}

	public void setTambolId1(String tambolId1) {
		this.tambolId1 = tambolId1;
	}

	public String getRegisterTambol() {
		return registerTambol;
	}

	public void setRegisterTambol(String registerTambol) {
		this.registerTambol = registerTambol;
	}

	public String getAmphur1() {
		return amphur1;
	}

	public void setAmphur1(String amphur1) {
		this.amphur1 = amphur1;
	}

	public String getRegisterAmphur() {
		return registerAmphur;
	}

	public void setRegisterAmphur(String registerAmphur) {
		this.registerAmphur = registerAmphur;
	}

	public String getProvince1() {
		return province1;
	}

	public void setProvince1(String province1) {
		this.province1 = province1;
	}

	public String getRegisterProvince() {
		return registerProvince;
	}

	public void setRegisterProvince(String registerProvince) {
		this.registerProvince = registerProvince;
	}

	public String getZipcode() {
		return zipcode;
	}

	public void setZipcode(String zipcode) {
		this.zipcode = zipcode;
	}

	public String getHomePhoneNo() {
		return homePhoneNo;
	}

	public void setHomePhoneNo(String homePhoneNo) {
		this.homePhoneNo = homePhoneNo;
	}

	public String getBusinessAddress() {
		return businessAddress;
	}

	public void setBusinessAddress(String businessAddress) {
		this.businessAddress = businessAddress;
	}

	public String getTambol2() {
		return tambol2;
	}

	public void setTambol2(String tambol2) {
		this.tambol2 = tambol2;
	}

	public String getBusinessTambol() {
		return businessTambol;
	}

	public void setBusinessTambol(String businessTambol) {
		this.businessTambol = businessTambol;
	}

	public String getAmphur2() {
		return amphur2;
	}

	public void setAmphur2(String amphur2) {
		this.amphur2 = amphur2;
	}

	public String getBusinessAmphurId() {
		return businessAmphurId;
	}

	public void setBusinessAmphurId(String businessAmphurId) {
		this.businessAmphurId = businessAmphurId;
	}

	public String getProvince2() {
		return province2;
	}

	public void setProvince2(String province2) {
		this.province2 = province2;
	}

	public String getBusinessProvince() {
		return businessProvince;
	}

	public void setBusinessProvince(String businessProvince) {
		this.businessProvince = businessProvince;
	}

	public String getBusinessZipcode() {
		return businessZipcode;
	}

	public void setBusinessZipcode(String businessZipcode) {
		this.businessZipcode = businessZipcode;
	}

	public String getWorkPhoneNo() {
		return workPhoneNo;
	}

	public void setWorkPhoneNo(String workPhoneNo) {
		this.workPhoneNo = workPhoneNo;
	}

	public String getWorkFax() {
		return workFax;
	}

	public void setWorkFax(String workFax) {
		this.workFax = workFax;
	}

	public String getContactAddress() {
		return contactAddress;
	}

	public void setContactAddress(String contactAddress) {
		this.contactAddress = contactAddress;
	}

	public String getTambol3() {
		return tambol3;
	}

	public void setTambol3(String tambol3) {
		this.tambol3 = tambol3;
	}

	public String getContactTambol() {
		return contactTambol;
	}

	public void setContactTambol(String contactTambol) {
		this.contactTambol = contactTambol;
	}

	public String getAmphur3() {
		return amphur3;
	}

	public void setAmphur3(String amphur3) {
		this.amphur3 = amphur3;
	}

	public String getContactAmphur() {
		return contactAmphur;
	}

	public void setContactAmphur(String contactAmphur) {
		this.contactAmphur = contactAmphur;
	}

	public String getProvince3() {
		return province3;
	}

	public void setProvince3(String province3) {
		this.province3 = province3;
	}

	public String getContactProvince() {
		return contactProvince;
	}

	public void setContactProvince(String contactProvince) {
		this.contactProvince = contactProvince;
	}

	public String getContactZipcode() {
		return contactZipcode;
	}

	public void setContactZipcode(String contactZipcode) {
		this.contactZipcode = contactZipcode;
	}

	public String getContactPhoneNo() {
		return contactPhoneNo;
	}

	public void setContactPhoneNo(String contactPhoneNo) {
		this.contactPhoneNo = contactPhoneNo;
	}

	public RecordInfo getRecordInfo() {
		return recordInfo;
	}

	public void setRecordInfo(RecordInfo recordInfo) {
		this.recordInfo = recordInfo;
	}
	
	@Transient
	public String getBondsFullname(){
		return this.getBondName().concat(" ").concat(this.getBondSurname());
	}
}
